Stacked series
A stacked series adds its values to the values of the series below it, so each point starts where the previous
series ended at the same X coordinate. There are four stacked series: StackedAreaSeries and
StackedStepAreaSeries are line series, StackedColumnSeries and StackedRowSeries are bar series. Each one takes
the properties of the series it is based on, so this article covers only what stacking changes; for the rest see the
line and step line series
and the column and row series
articles.
This article highlights the most used features. Every property is listed in the API explorer:
StackedAreaSeries,
StackedStepAreaSeries,
StackedColumnSeries and
StackedRowSeries.
In XAML, declare them as XamlStackedAreaSeries, XamlStackedStepAreaSeries, XamlStackedColumnSeries and
XamlStackedRowSeries.
Stacked area
Add two or more StackedAreaSeries to the chart and they stack in the order of the series collection: the first
series is at the bottom. A stacked area takes the same properties as a LineSeries, such as LineSmoothness, only
the defaults of the theme change: each area is filled with a solid color, with no line and no point geometries.

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="MauiSample.StackedArea.Basic.View"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.Maui;assembly=LiveChartsCore.SkiaSharpView.Maui"
xmlns:vms="clr-namespace:ViewModelsSamples.StackedArea.Basic;assembly=ViewModelsSamples"
x:DataType="vms:ViewModel">
<ContentPage.BindingContext>
<vms:ViewModel/>
</ContentPage.BindingContext>
<lvc:CartesianChart>
<lvc:CartesianChart.Series>
<lvc:SeriesCollection>
<lvc:XamlStackedAreaSeries Values="{Binding Values1}"/>
<lvc:XamlStackedAreaSeries Values="{Binding Values2}"/>
<lvc:XamlStackedAreaSeries Values="{Binding Values3}"/>
</lvc:SeriesCollection>
</lvc:CartesianChart.Series>
</lvc:CartesianChart>
</ContentPage>
namespace ViewModelsSamples.StackedArea.Basic;
public class ViewModel
{
public double[] Values1 { get; set; } = [3, 2, 3, 5, 3, 4, 6];
public double[] Values2 { get; set; } = [6, 5, 6, 3, 8, 5, 2];
public double[] Values3 { get; set; } = [4, 8, 2, 8, 9, 5, 3];
}
Stacked step area
StackedStepAreaSeries stacks step lines the same way and takes the same properties as a StepLineSeries. Step
areas and smooth areas do not stack with each other: every StackedStepAreaSeries in the chart forms one stack, and
every StackedAreaSeries forms another.

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="MauiSample.StackedArea.StepArea.View"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.Maui;assembly=LiveChartsCore.SkiaSharpView.Maui"
xmlns:vms="clr-namespace:ViewModelsSamples.StackedArea.StepArea;assembly=ViewModelsSamples"
x:DataType="vms:ViewModel">
<ContentPage.BindingContext>
<vms:ViewModel/>
</ContentPage.BindingContext>
<lvc:CartesianChart>
<lvc:CartesianChart.Series>
<lvc:SeriesCollection>
<lvc:XamlStackedStepAreaSeries Values="{Binding Values1}"/>
<lvc:XamlStackedStepAreaSeries Values="{Binding Values2}"/>
<lvc:XamlStackedStepAreaSeries Values="{Binding Values3}"/>
</lvc:SeriesCollection>
</lvc:CartesianChart.Series>
</lvc:CartesianChart>
</ContentPage>
namespace ViewModelsSamples.StackedArea.StepArea;
public class ViewModel
{
public double[] Values1 { get; set; } = [3, 2, 3, 5, 3, 4, 6];
public double[] Values2 { get; set; } = [6, 5, 6, 3, 8, 5, 2];
public double[] Values3 { get; set; } = [4, 8, 2, 8, 9, 5, 3];
}
Stacked columns
StackedColumnSeries stacks bars vertically. Positive values stack up from zero and negative values stack down from
zero, each sign on its own. The default theme draws stacked bars with square corners, and places data labels in the
middle of each bar when ShowDataLabels is true.
Every point of a stacked series has a StackedValue property with the Start, End and Total of the stack, and
its Share: the part of the point in the total of its sign at that X coordinate, from 0 to 1. This sample shows
the share in the tooltip with YToolTipLabelFormatter, see the
tooltips article for more.

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="MauiSample.StackedBars.Basic.View"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.Maui;assembly=LiveChartsCore.SkiaSharpView.Maui"
xmlns:vms="clr-namespace:ViewModelsSamples.StackedBars.Basic;assembly=ViewModelsSamples"
x:DataType="vms:ViewModel">
<ContentPage.BindingContext>
<vms:ViewModel/>
</ContentPage.BindingContext>
<lvc:CartesianChart>
<lvc:CartesianChart.Series>
<lvc:SeriesCollection>
<lvc:XamlStackedColumnSeries
Values="{Binding Values1}"
ShowDataLabels="True"
YToolTipLabelFormatter="{Binding Formatter}"/>
<lvc:XamlStackedColumnSeries
Values="{Binding Values2}"
ShowDataLabels="True"
YToolTipLabelFormatter="{Binding Formatter}"/>
<lvc:XamlStackedColumnSeries
Values="{Binding Values3}"
ShowDataLabels="True"
YToolTipLabelFormatter="{Binding Formatter}"/>
</lvc:SeriesCollection>
</lvc:CartesianChart.Series>
</lvc:CartesianChart>
</ContentPage>
using System;
using LiveChartsCore.Kernel;
namespace ViewModelsSamples.StackedBars.Basic;
public class ViewModel
{
public int[] Values1 { get; set; } =
[3, 5, -3, 2, 5, -4, -2];
public int[] Values2 { get; set; } =
[4, 2, -3, 2, 3, 4, -2];
public int[] Values3 { get; set; } =
[-2, 6, 6, 5, 4, 3, -2];
public Func<ChartPoint, string> Formatter { get; set; } =
p => $"{p.Coordinate.PrimaryValue:N} ({p.StackedValue!.Share:P})";
}
Stacked rows
StackedRowSeries takes the same properties and stacks bars horizontally: the values go on the X axis and the
categories on the Y axis.
Series = new ISeries[]
{
new StackedRowSeries<int> { Values = new [] { 3, 5, 3, 2 } },
new StackedRowSeries<int> { Values = new [] { 4, 2, 3, 2 } },
new StackedRowSeries<int> { Values = new [] { 4, 6, 6, 5 } }
};
Stack groups
Stacked columns and rows have a StackGroup property, 0 by default. Series with the same group stack together,
and each group gets its own bar in the category, placed side by side in the order the groups first appear in the
series collection. This sample stacks the first two series in group 0 and the last two in group 1.

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="MauiSample.StackedBars.Groups.View"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.Maui;assembly=LiveChartsCore.SkiaSharpView.Maui"
xmlns:vms="clr-namespace:ViewModelsSamples.StackedBars.Groups;assembly=ViewModelsSamples"
x:DataType="vms:ViewModel">
<ContentPage.BindingContext>
<vms:ViewModel/>
</ContentPage.BindingContext>
<lvc:CartesianChart>
<lvc:CartesianChart.Series>
<lvc:SeriesCollection>
<lvc:XamlStackedColumnSeries Values="{Binding Values1}" StackGroup="0"/>
<lvc:XamlStackedColumnSeries Values="{Binding Values2}" StackGroup="0"/>
<lvc:XamlStackedColumnSeries Values="{Binding Values3}" StackGroup="1"/>
<lvc:XamlStackedColumnSeries Values="{Binding Values4}" StackGroup="1"/>
</lvc:SeriesCollection>
</lvc:CartesianChart.Series>
<lvc:CartesianChart.XAxes>
<lvc:AxesCollection>
<lvc:XamlAxis
LabelsRotation="-15"
Labels="{Binding Labels}"
MinStep="1"
ForceStepToMin="True"/>
</lvc:AxesCollection>
</lvc:CartesianChart.XAxes>
</lvc:CartesianChart>
</ContentPage>
namespace ViewModelsSamples.StackedBars.Groups;
public class ViewModel
{
public int[] Values1 { get; set; } = [3, 5, 3];
public int[] Values2 { get; set; } = [4, 2, 3];
public int[] Values3 { get; set; } = [4, 6, 6];
public int[] Values4 { get; set; } = [2, 5, 4];
public string[] Labels { get; set; } =
["Category 1", "Category 2", "Category 3"];
}
Stacked area and step area series have no StackGroup.
Stroke and fill paints
When Fill is not set, LiveCharts picks it from the current theme, based on the position of the series in the
chart's series collection. The default theme draws stacked series with no Stroke.
Stroke draws the line on top of each area:

Series = new ISeries[]
{
new StackedAreaSeries<int>
{
Values = new [] { 4, 4, 7, 2, 8 },
Stroke = new SolidColorPaint(SKColors.Blue) { StrokeThickness = 4 }, // mark
Fill = null,
GeometryFill = null,
GeometryStroke = null
},
new StackedAreaSeries<int>
{
Values = new [] { 7, 5, 3, 2, 6 },
Stroke = new SolidColorPaint(SKColors.Red) { StrokeThickness = 8 }, // mark
Fill = null,
GeometryFill = null,
GeometryStroke = null
},
new StackedAreaSeries<int>
{
Values = new [] { 4, 2, 5, 3, 9 },
Stroke = new SolidColorPaint(SKColors.Green) { StrokeThickness = 1 }, // mark
Fill = null,
GeometryFill = null,
GeometryStroke = null
}
};
Fill paints each area. Every area is filled down to the bottom of the chart and the lower series are drawn on top
of the upper ones, so with a transparent fill the colors of the layers mix:

Series = new ISeries[]
{
new StackedAreaSeries<int>
{
Values = new [] { 4, 4, 7, 2, 8 },
Fill = new SolidColorPaint(SKColors.Blue.WithAlpha(90)), // mark
Stroke = null,
GeometryFill = null,
GeometryStroke = null
},
new StackedAreaSeries<int>
{
Values = new [] { 7, 5, 3, 2, 6 },
Fill = new SolidColorPaint(SKColors.Red.WithAlpha(90)), // mark
Stroke = null,
GeometryFill = null,
GeometryStroke = null
},
new StackedAreaSeries<int>
{
Values = new [] { 4, 2, 5, 3, 9 },
Fill = new SolidColorPaint(SKColors.Green.WithAlpha(90)), // mark
Stroke = null,
GeometryFill = null,
GeometryStroke = null
}
};
On stacked columns and rows, Stroke draws the border of each bar:

Series = new ISeries[]
{
new StackedColumnSeries<int>
{
Values = new List<int> { 3, 5, 3, 2, 5, 4, 2 },
Stroke = new SolidColorPaint(SKColors.Red) { StrokeThickness = 4 }, // mark
Fill = null,
},
new StackedColumnSeries<int>
{
Values = new List<int> { 4, 2, 3, 2, 3, 4, 2 },
Stroke = new SolidColorPaint(SKColors.Blue) { StrokeThickness = 8 }, // mark
Fill = null,
},
new StackedColumnSeries<int>
{
Values = new List<int> { 4, 6, 6, 5, 4, 3 , 2 },
Stroke = new SolidColorPaint(SKColors.Green) { StrokeThickness = 12 }, // mark
Fill = null,
}
};
And Fill paints the inside of each bar:

Series = new ISeries[]
{
new StackedColumnSeries<int>
{
Values = new List<int> { 3, 5, 3, 2, 5, 4, 2 },
Fill = new SolidColorPaint(SKColors.Red), // mark
Stroke = null,
},
new StackedColumnSeries<int>
{
Values = new List<int> { 4, 2, 3, 2, 3, 4, 2 },
Fill = new SolidColorPaint(SKColors.Blue), // mark
Stroke = null,
},
new StackedColumnSeries<int>
{
Values = new List<int> { 4, 6, 6, 5, 4, 3 , 2 },
Fill = new SolidColorPaint(SKColors.Green), // mark
Stroke = null,
}
};
Paints can also draw gradients and dashed lines, see the Paints article.
Point geometries
Stacked area and step area series hide their point geometries: GeometrySize is 0 by default. Set GeometrySize,
GeometryFill and GeometryStroke to show them:

Series = new ISeries[]
{
new StackedAreaSeries<int>
{
Values = new [] { 4, 4, 7, 2, 8 },
GeometrySize = 20, // mark
GeometryFill = new SolidColorPaint(SKColors.WhiteSmoke), // mark
GeometryStroke = new SolidColorPaint(SKColors.Red) { StrokeThickness = 3 }, // mark
},
new StackedAreaSeries<int>
{
Values = new [] { 7, 5, 3, 2, 6 },
GeometrySize = 20, // mark
GeometryFill = new SolidColorPaint(SKColors.WhiteSmoke), // mark
GeometryStroke = new SolidColorPaint(SKColors.Green) { StrokeThickness = 6 }, // mark
},
new StackedAreaSeries<int>
{
Values = new [] { 4, 2, 5, 3, 9 },
GeometrySize = 20, // mark
GeometryFill = new SolidColorPaint(SKColors.WhiteSmoke), // mark
GeometryStroke = new SolidColorPaint(SKColors.Blue) { StrokeThickness = 10 }, // mark
}
};
Rounded corners
Rx and Ry set the radius of the corners of each bar, in pixels. On stacked bars the default theme sets them to
0, a column series gets 3.

Series = new ISeries[]
{
new StackedColumnSeries<int>
{
Values = new List<int> { 3, 5, 3, 2, 5, 4, 2 },
Rx = 50, // mark
Ry = 50 // mark
},
new StackedColumnSeries<int>
{
Values = new List<int> { 4, 2, 3, 2, 3, 4, 2 },
Rx = 50, // mark
Ry = 50 // mark
},
new StackedColumnSeries<int>
{
Values = new List<int> { 4, 6, 6, 5, 4, 3 , 2 },
Rx = 50, // mark
Ry = 50 // mark
}
};
MaxBarWidth and Padding work as on a column series, see
width and spacing.
The space of a category is shared by the stack groups, not by the series.
Data, names and updates
Valuestakes anyIEnumerable<T>. Use anObservableCollection<T>and the chart animates every added, removed or replaced value, see automatic updates.- Points stack when they have the same X coordinate (Y on rows). To plot your own types, or set both X and Y, see mappers.
Name(SeriesNamein XAML) is shown in tooltips and legends. When it is not set, the tooltip shows the values without a series name.IsVisibleshows or hides the series.ZIndexsets which series draws on top; when it is not set, the series of a stacked area draw from the top layer to the bottom one.